{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                  \n",
      "   * * * * * *    \n",
      "    * * * * *     \n",
      "     * * * *      \n",
      "      * * *       \n",
      "       * *        \n",
      "        *         \n",
      "        *         \n",
      "   * * * * * *    \n",
      "    * * * * *     \n",
      "     * * * *      \n",
      "      * * *       \n",
      "       * *        \n",
      "        *         \n",
      "       * *        \n",
      "   * * * * * *    \n",
      "    * * * * *     \n",
      "     * * * *      \n",
      "      * * *       \n",
      "       * *        \n",
      "        *         \n",
      "      * * *       \n",
      "   * * * * * *    \n",
      "    * * * * *     \n",
      "     * * * *      \n",
      "      * * *       \n",
      "       * *        \n",
      "        *         \n",
      "     * * * *      \n",
      "   * * * * * *    \n",
      "    * * * * *     \n",
      "     * * * *      \n",
      "      * * *       \n",
      "       * *        \n",
      "        *         \n",
      "    * * * * *     \n",
      "   * * * * * *    \n",
      "    * * * * *     \n",
      "     * * * *      \n",
      "      * * *       \n",
      "       * *        \n",
      "        *         \n"
     ]
    }
   ],
   "source": [
    "n = int(input('输入一个整数：'))\n",
    "for i in range(n):\n",
    "    print(('* '*i).center(n*3))\n",
    "\n",
    "    for i in range(n,0,-1):\n",
    "        print(('* '*i).center(n*3))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.9"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
